//
//  IMImageMessage.m
//  MLIM
//
//  Created by molon on 15/6/29.
//  Copyright (c) 2015年 molon. All rights reserved.
//

#import "IMImageMessage.h"
#import "IMCommon.h"

@implementation IMImageMessage

- (instancetype)initWithCoder:(NSCoder *)coder
{
    self = [super initWithCoder:coder];
    if (self) {
        self.imageURL = [coder decodeObjectForKey:SELSTR(imageURL)];
        self.imageHeight = [[coder decodeObjectForKey:SELSTR(imageHeight)] doubleValue];
        self.imageWidth = [[coder decodeObjectForKey:SELSTR(imageWidth)] doubleValue];
    }
    return self;
}

- (void)encodeWithCoder:(NSCoder *)aCoder {
    [super encodeWithCoder:aCoder];
    
    [aCoder encodeObject:self.imageURL forKey:SELSTR(imageURL)];
    [aCoder encodeObject:@(self.imageHeight) forKey:SELSTR(imageHeight)];
    [aCoder encodeObject:@(self.imageWidth) forKey:SELSTR(imageWidth)];
}

- (id)simpleDescription
{
    static NSString *imageSign = @"[图片]";
    
    return imageSign;
}

@end
